package com.fxp.project.jiuselu.web.business.v1.controller.findimg;


import com.fxp.project.jiuselu.web.base.controller.BaseController;
import com.fxp.project.jiuselu.web.base.request.ReqBase;
import com.fxp.project.jiuselu.web.domain.CommonResult;
import com.fxp.project.jiuselu.web.models.goods.entity.FindImg;
import com.fxp.project.jiuselu.web.models.goods.entity.JslBanner;
import com.fxp.project.jiuselu.web.models.goods.service.IFindImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 发现模块图片设置Controller
 *
 * @author Jason.Wang
 * @date 2022-06-01
 */
@RestController
@RequestMapping("/v1/find/img")
public class FindImgController extends BaseController
{
    @Autowired
    private IFindImgService findImgService;

    /**
     * list: 获取当前需要展示的Banner信息<br/>
     *
     * @param reqBase
     * @param result
     * @return
     * @author Kai.Wang
     * @date 2021/11/1 16:42
     */
    @PostMapping("list")
    @CrossOrigin
    public CommonResult list(@RequestBody @Validated ReqBase reqBase, BindingResult result) {
        super.checkBindResult(result);
        List<FindImg> list = findImgService.selectFindListByPlatform(reqBase.getPlatform());
        return CommonResult.success(list);
    }

//    /**
//     * 导出发现模块图片设置列表
//     */
////    @PreAuthorize("@ss.hasPermi('system:img:export')")
//    @Log(title = "发现模块图片设置", businessType = BusinessType.EXPORT)
//    @GetMapping("/export")
//    public AjaxResult export(FindImg findImg)
//    {
//        List<FindImg> list = findImgService.selectFindImgList(findImg);
//        ExcelUtil<FindImg> util = new ExcelUtil<FindImg>(FindImg.class);
//        return util.exportExcel(list, "发现模块图片设置数据");
//    }
//
//    /**
//     * 获取发现模块图片设置详细信息
//     */
////    @PreAuthorize("@ss.hasPermi('system:img:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return AjaxResult.success(findImgService.selectFindImgById(id));
//    }
//
//    /**
//     * 新增发现模块图片设置
//     */
////    @PreAuthorize("@ss.hasPermi('system:img:add')")
//    @Log(title = "发现模块图片设置", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody FindImg findImg)
//    {
//        return toAjax(findImgService.insertFindImg(findImg));
//    }
//
//    /**
//     * 修改发现模块图片设置
//     */
////    @PreAuthorize("@ss.hasPermi('system:img:edit')")
//    @Log(title = "发现模块图片设置", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody FindImg findImg)
//    {
//        return toAjax(findImgService.updateFindImg(findImg));
//    }
//
//    /**
//     * 删除发现模块图片设置
//     */
////    @PreAuthorize("@ss.hasPermi('system:img:remove')")
//    @Log(title = "发现模块图片设置", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids)
//    {
//        return toAjax(findImgService.deleteFindImgByIds(ids));
//    }
}
